export type GetApiAccountsAccountIdVideosVideoIdDashVmapArgs = {bcov_auth: string, account_id: string, video_id: string, config_id?: string | undefined, Authorization: string, 'BCOV-Policy': string, Accept: string}; export type GetApiAccountsAccountIdVideosVideoIdDashVmapOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get an DASH VMAP with static URLs * * GET /accounts/{{account_id}}/videos/{{video_id}}/dash.vmap */ export const getApiAccountsAccountIdVideosVideoIdDashVmap = async (args: GetApiAccountsAccountIdVideosVideoIdDashVmapArgs, options?: GetApiAccountsAccountIdVideosVideoIdDashVmapOptions) => { const {baseUrl = "https://edge.api.brightcove.com/playback/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.bcov_auth != null) query.append("bcov_auth", String(args.bcov_auth)) if (args.config_id != null) query.append("config_id", String(args.config_id)) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['BCOV-Policy'] != null) headers.set("BCOV-Policy", String(args['BCOV-Policy'])) if (args.Accept != null) headers.set("Accept", String(args.Accept)) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args['{account_id']))}}/videos/${encodeURIComponent(String(args['{video_id']))}}/dash.vmap${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };